package com.cxd.springcloud.controller;

import com.cxd.springcloud.entities.Payment;
import com.cxd.springcloud.feign.PaymentFeign;
import com.cxd.springcloud.vo.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class PaymentController {

    @Resource
    private PaymentFeign paymentFeign;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id")Long id) {

        return paymentFeign.getPayment(id);
    }

    @GetMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeout() {

        return paymentFeign.paymentFeignTimeout();
    }
}
